<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./sha1.min.js"></script>
</head>
<body>
  <pre>
    secretSignature: <span id="sign"></span>

    <button id="btn">生成签名</button>
  </pre>
</body>
<script defer>
  
  const btn = document.querySelector('#btn')
  const secretSignature = document.querySelector('#sign')
  console.log(secretSignature)
  
  let data = `appid=a82f573889b2dc4922472cd38b5e74a4&appsecret=4bad4a8860a73a8f423b3e24e462118e&noncestr=VhA2cdAW5t9W7974pz36G0E375589Siu&timestamp=1631955172`
  btn.onclick = function(){
    secretSignature.innerHTML = sha1(data)
  }
  
</script>
</html>